<template>
	<view class="content">
		<u-cell-group title="个人信息:">
			<u-cell-item icon="" title="患者姓名" hover-class="none" :value="info.patientName" :arrow="false"></u-cell-item>
			<u-cell-item icon="" title="电话号码" hover-class="none" :value="info.patientTel" :arrow="false"></u-cell-item>
			<u-cell-item icon="" title="患者身份证" hover-class="none" :value="info.patientIdcard"
				:arrow="false"></u-cell-item>
			<u-cell-item icon="" title="性别" hover-class="none" :value="info.patientSex" :arrow="false"></u-cell-item>
			<u-cell-item icon="" title="年龄" hover-class="none" :value="info.patientAge" :arrow="false"></u-cell-item>
			<u-cell-item icon="" title="患者家庭住址" hover-class="none" :value="info.patientAddress"
				:arrow="false"></u-cell-item>
		</u-cell-group>

		<!-- 	<u-cell-group title="实名:">
				<u-cell-item icon="integral-fill" title="实名认证" :value="auth_txt"  @click="auth"></u-cell-item>
		</u-cell-group>
		 -->

		<u-cell-group title="其他信息:">
			<u-cell-item icon="" title="诊断" hover-class="none" :value="info.diagnosticReasons"
				:arrow="false"></u-cell-item>
			<u-cell-item icon="" title="住院号" hover-class="none" :value="info.patientNo" :arrow="false"></u-cell-item>
			<u-cell-item icon="" title="患者所在科室" hover-class="none" :value="info.patientDepartment"
				:arrow="false"></u-cell-item>
			<u-cell-item icon="" title="患者疾病类型" hover-class="none" :value="info.patientType"
				:arrow="false"></u-cell-item>
			<u-cell-item icon="" title="其他基础疾病" hover-class="none" :value="info.otherDiseases"
				:arrow="false"></u-cell-item>
			<u-cell-item icon="" title="医保方式" hover-class="none" :value="info.insuranceMethod"
				:arrow="false"></u-cell-item>
			<u-cell-item icon="" title="住院天数" hover-class="none" :value="info.patientDays" :arrow="false"></u-cell-item>
			<u-cell-item icon="" title="出院时间" hover-class="none" :value="info.patientTime" :arrow="false"></u-cell-item>
			<u-cell-item icon="" title="术前抗肿瘤治疗" hover-class="none" :value="info.tumorTreatment"
				:arrow="false"></u-cell-item>
			<u-cell-item icon="" title="术前镇痛药物" hover-class="none" :value="info.analgesics"
				:arrow="false"></u-cell-item>
			<u-cell-item icon="" title="术后镇痛药物" hover-class="none" :value="info.implantation"
				:arrow="false"></u-cell-item>
			<u-cell-item icon="" title="是否植入/方式" hover-class="none" :value="info.implantationMethod"
				:arrow="false"></u-cell-item>
			<u-cell-item icon="" title="麻醉方式" hover-class="none" :value="info.anesthesia" :arrow="false"></u-cell-item>
			<u-cell-item icon="" title="手术时间" hover-class="none" :value="info.operativeTime?info.operativeTime:''"
				:arrow="false"></u-cell-item>
			<u-cell-item icon="" title="导管尖端放置平面" hover-class="none" :value="info.conduit" :arrow="false"></u-cell-item>

		</u-cell-group>

		<u-cell-group title="患者家属信息:">
			<u-cell-item icon="" title="患者家属" hover-class="none" :value="info.patientFamily"
				:arrow="false"></u-cell-item>
			<u-cell-item icon="" title="患者家属性别" hover-class="none" :value="info.patientFamilySex"
				:arrow="false"></u-cell-item>
			<u-cell-item icon="" title="患者家属关系" hover-class="none" :value="info.patientFamilyKinship"
				:arrow="false"></u-cell-item>
			<u-cell-item icon="" title="患者家属手机号" hover-class="none" :value="info.patientFamilyTel"
				:arrow="false"></u-cell-item>
			<u-cell-item icon="" title="是否同居陪护" hover-class="none" :value="info.patientFamilyAccompany"
				:arrow="false"></u-cell-item>
			<u-cell-item icon="" title="患者家属身份证" hover-class="none" :value="info.patientFamilyIdcard"
				:arrow="false"></u-cell-item>
			<u-cell-item icon="" title="患者家属家庭住址" hover-class="none" :value="info.patientFamilyAddress"
				:arrow="false"></u-cell-item>
		</u-cell-group>
		<view style="height: 100rpx;"></view>
	</view>
</template>
<script>
	import {
		toast,
		clearStorageSync,
		setStorageSync,
		getStorageSync,
		useRouter
	} from '@/utils/utils.js'
	export default {
		data() {
			return {
				info: {},
				patientId: ""
			}
		},
		async onLoad(options) {
			console.log(options)
			if (options.data) {
				let data = decodeURIComponent(options.data)
				let params = JSON.parse(data)
				console.log(params)
				if (params.patientId) {
					this.patientId = params.patientId;
					await this.getPatientInfoById();
				} else {
					this.info = this.userInfo;
				}
			} else {
				this.info = this.userInfo;
			}
		},
		onShow() {},
		onReady() {

		},
		methods: {
			async getPatientInfoById() {
				try {
					let res = await this.$api.getPatientInfoById(this.patientId, true);
					console.log(res)
					this.info = res.patient
				} catch (e) {
					toast("查询失败")
				}

			}
		}
	}
</script>
<style lang="scss" scoped>
	page {
		background: #f2f2f2
	}
</style>
